You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PYTHON-6054 Align span and log operation names with the OTel spec - #3111
Aligns db.operation.name reported on tracing spans with the operation names defined in the OpenTelemetry specification, and uses the same names in server selection logging (falling back to the command name for commands without a listed operation):
countDocuments, watch, renameCollection, collection-level bulkWrite, and both generic command helpers.
Also:
Resyncs the OpenTelemetry and server selection logging spec tests with the spec update.
Guards the client bulk_write span tests to servers with the bulkWrite command.
Sweeps the otel variant across all supported server versions.
Test Plan
Updated the otel span tests and resynced the unified spec tests (test_otel*.py, test/unified_format.py).
Green patch build across all supported server versions
Standard Evergreen builds for server logging
Checklist
Checklist for Author
Did you update the changelog (if necessary)? N/A
Is there test coverage?
Is any followup work tracked in a JIRA ticket? If so, add link(s). This will be combined with other tickets for OTel operation span support.
Checklist for Reviewer
Does the title of the PR reference a JIRA Ticket?
Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
Is all relevant documentation (README or docstring) updated?
Report db.operation.name for countDocuments, watch, renameCollection,
collection-level bulkWrite, and both generic command helpers, per
DRIVERS-3625. Use the same names in server selection logging, falling
back to the command name for commands without a listed operation. Resync
the OpenTelemetry and server selection logging spec tests, guard the
client bulk_write span tests to servers with the bulkWrite command, and
sweep the otel variant across all supported server versions.
This fixture is not fully resynced with the linked DRIVERS-3625 spec PR: the companion collection_bulk_write.json has a fourth case, uniform delete write models report delete, after this update case. Without it, the newly added DeleteOne/DeleteMany operation-name branch is never exercised as a uniform bulk.
Missing uniform update and delete bulk-write server-selection cases
The linked DRIVERS-3625 server-selection fixture includes uniform update and uniform delete collection bulk-write cases here, but this resync jumps directly from uniform insert to runCommand. Those omissions leave the new server-selection operation names for these two uniform bulk types unverified.
- Construct server selection telemetry for info-enabled logging so INFO
users receive the WAITING message; add an INFO-only regression test
- Match the OpenTelemetry Span API signatures in the test span stub and
complete the _ConnectionTelemetryInfo protocol fields for mypy strict
- Stop generating operation ids for info-only server selection logging;
the spec makes operationId optional when the driver generates none
- Re-sync the collection bulk write and logging fixtures with the spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-6054
Companion spec PR: DRIVERS-3625 (mongodb/specifications#1993)
Changes in this PR
Aligns
db.operation.namereported on tracing spans with the operation names defined in the OpenTelemetry specification, and uses the same names in server selection logging (falling back to the command name for commands without a listed operation):countDocuments,watch,renameCollection, collection-levelbulkWrite, and both generic command helpers.Also:
bulk_writespan tests to servers with thebulkWritecommand.Test Plan
test_otel*.py,test/unified_format.py).Checklist
Checklist for Author
Checklist for Reviewer